package List;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: leep
 * Date: 16-2-22
 * Time: 下午3:32
 * To change this template use File | Settings | File Templates.
 */
public class ListMain {
	public static void main(String[] args) {
		List<A> list = new ArrayList();
		A a = new A();
		a.id = 1;
		a.name = "1";

		A b = new A();
		b.id = 2;
		b.name = "2";
		list.add(a);
		list.add(b);
		A c = new A();
		c.id = 1;
		c.name = "1";

		System.out.println(list.indexOf(c));
	}

	static class A {
		public int id;
		public String name;
	}
}
